package com.parkinglot.enumeration;


public enum DateTypeEnum {

    YESTERDAY("yesterDay", "昨天"),
    LASTWEEK("lastWeek", "上周"),
    LASTMONTH("lastMonth", "上月");


    private String code;

    private String explain;

    DateTypeEnum(String code, String explain) {
        this.code = code;
        this.explain = explain;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getExplain() {
        return explain;
    }

    public void setExplain(String explain) {
        this.explain = explain;
    }

    public static DateTypeEnum getStatusByCode(String code) {
        if (code ==  null){
            return null;
        }
        for (DateTypeEnum i : DateTypeEnum.values()) {
            if (code.equals(i.getCode())) {
                return i;
            }
        }
        return null;
    }
    @Override
    public String toString() {
        return code + '-' + explain;
    }
}
